#include <iostream>
#include <algorithm>
#include <queue>

using namespace std;

int main() {
    int n, k;
    long long sum = 0;
    cin >> n >> k;
    
    priority_queue<int> even;
    while (n--)
    {
        int x;
        cin >> x;
        if (x % 2 == 0)
            even.push(x);
        else
            sum += x;
    }

    while (k-- && !even.empty())
    {
        int tmp = even.top();
        even.pop();

        tmp /= 2;
        if (tmp % 2 == 0)
            even.push(tmp);
        else
            sum += tmp;
    }

    while (!even.empty())
    {
        int tmp = even.top();
        even.pop();

        sum += tmp;
    }
 
    cout << sum <<  endl;
    
    return 0;
}
// 64 位输出请用 printf("%lld")